public class Test {
    public static void print(int n){
        if(n < 10){
            System.out.println(n);
        }else{
            print(n/10);
            System.out.println(n % 10);
        }

    }
    public static void main(String[] args) {
        print(1234);
    }
}
